package cn.sdack.go.common.entities.users;

import cn.sdack.go.common.entities.PermissionEntity;
import jakarta.persistence.*;
import lombok.*;

/**
 * 角色
 * @author sdack
 * @date 2024/1/8
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "user_roles", indexes = {
        @Index(name = "idx_user_roles_userid_code",columnList = "userId,roleCode"),
        @Index(name = "idx_user_roles_account",columnList = "account"),
})
public class UserRoleEntity extends PermissionEntity {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    private Long userId;

    // 授权服务器账号
    @Column(length = 50)
    private String account;

    // 英文标签
    @Column(length = 50, nullable = false)
    private String roleCode;

    //中文 描述
    @Transient
    private String remark;



}
